/*
 * Copyright 2010 Michael Nitsche
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package de.mnit.basis.db.sql;

import de.mnit.basis.db.zugang.S_DBZugang;
import de.mnit.basis.fehler.Fehler;

/**
 * @author Michael Nitsche
 */
public class MySQL extends A_SqlDB {

	public MySQL(S_DBZugang dbz)                                   { super(dbz.gHost(), dbz.gDB(), dbz.gUser(), dbz.gPass(), false); }
	public MySQL(String host, String db, String user, String pass) { super(host,db,user,pass,false); }

	/*
	 * "?useUnicode=true&characterEncoding=UTF-8" wird benötigt, da sonst MySQL kein €-Zeichen speichert!
	 * http://www.torsten-horn.de/techdocs/sql-utf8.htm
	 */
	protected String jdbc(String host, String db) {
		return "jdbc:mysql://"+host+":3306/"+db+"?useUnicode=true&characterEncoding=UTF-8";
	}

	protected String treiber() {
		return "com.mysql.jdbc.Driver";
	}

	protected void erstelle(String host, String db, String user, String pass) {
		Fehler.sonstige.da_ToDo();
	}

}
